

import utils_file_local
def do_handle_1():
    input_path = "/home/node27_tmpdata/xlgeng/pachong_10W_data/fairseq_data/manifest/chat_3500/train.tsv"
    dict_info = utils_file_local.load_dict_from_tsv(input_path, is_relpath=False)
    new_dict = {}
    for key, value in dict_info.items():
        if "/home/work_nfs15/tts_data/data/3500h_dialog/wavs" in key:
            new_key = key.replace("/home/work_nfs15/tts_data/data/3500h_dialog/wavs", "/home/node27_tmpdata/xlgeng/pachong_10W_data/raw_wav/chat_3500")
            value = int(value)
            new_value = value//3
            new_dict[new_key] = str(new_value)
        else:
            new_dict[key] = value
    utils_file_local.save_dict_to_tsv(new_dict, input_path)

if __name__ == "__main__":
    do_handle_1()


